package org.jeecg.modules.basesource.utils.cwbb;

import org.jeecg.modules.basesource.constant.CwbbKjzzEnum;
import org.jeecg.modules.dzswj.vo.response.cwbb.GsCwbbVo;

/**
 * @author chensherun on 2022/9/7.
 * @version 1.0
 */
public class CwbbUtil {

    public static CwbbKjzzEnum checkKjzz(GsCwbbVo gsCwbbVo) {
        //适用于101，102，201三个才保存原始报文
        //一般企业
        if (gsCwbbVo.getYbqylrbVO() != null
                || gsCwbbVo.getYbqyxjllbVO() != null
                || gsCwbbVo.getYbqyzcfzbVO() != null
                || gsCwbbVo.getYbqylrbyzxVO() != null
                || gsCwbbVo.getYbqyzcfzbyzxVO() != null) {
            //判断是否已执行新金融
            if (gsCwbbVo.getYbqylrbyzxVO() != null
                    || gsCwbbVo.getYbqyzcfzbyzxVO() != null) {
                return CwbbKjzzEnum.QYKJZZ_YBQYYZX;
            } else {
                return CwbbKjzzEnum.QYKJZZ_YBQY;
            }
        } else if (gsCwbbVo.getSyxqylrb() != null
                || gsCwbbVo.getSyxqyxjllb() != null
                || gsCwbbVo.getSyxqyzcfzb() != null
                || gsCwbbVo.getXqylrbnb() != null) {
            return CwbbKjzzEnum.XQYKJZZ;
        } else if (gsCwbbVo.getQykjzdcwbbzcfzbVO() != null) {
            return CwbbKjzzEnum.QYKJZD;
        }
        return null;
    }
}
